import com.tebiecloud.generator.server.service.GenerateConfig;
import com.tebiecloud.generator.server.service.GeneratorService;

import java.io.File;

/**
 * 代码生成参数配置
 * @Author: tebie
 * @Date: 2019-07-31 08:58
 */
public class GeneratorMain {

    public static void main(String[] args) {
        String outputDir = System.getProperty("user.dir") + File.separator + "doc" + File.separator + "generator";
        GenerateConfig config = new GenerateConfig();
//        config.setJdbcUrl("jdbc:mysql://localhost:3306/tebie-cloud-base?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC");
//        config.setJdbcUserName("root");
//        config.setJdbcPassword("123456");
        config.setJdbcUrl("jdbc:mysql://112.74.179.177:43306/tebie-cloud-base?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC");
        config.setJdbcUserName("root");
        config.setJdbcPassword("qqs123456");
        config.setJdbcDriver("com.mysql.cj.jdbc.Driver");
        config.setAuthor("tebie");
        config.setParentPackage("com.tebiecloud");
        config.setModuleName("order");
        config.setIncludeTables(new String[]{"reserve"});
//        config.setModuleName("order");
//        config.setIncludeTables(new String[]{"order", "order_goods", "order_stats1", "order_refund"});
//        config.setModuleName("order");
//        config.setIncludeTables(new String[]{"orderr"});
//        config.setModuleName("mpopen");
//        config.setIncludeTables(new String[]{"mpopen_authorization_info", "mpopen_authorizer_info"});
//        config.setModuleName("mpweixin");
//        config.setIncludeTables(new String[]{"mpmini_user", "mpmini_account_ref"});
        config.setModuleName("order");
        config.setIncludeTables(new String[]{"orderr", "order_goods", "order_stats1", "order_refund", "order_stats2", "order_write_off_log"});
//        config.setModuleName("yunst");
//        config.setIncludeTables(new String[]{"yun_withdraw_apply"});
//        config.setModuleName("store");
//        config.setIncludeTables(new String[]{"store", "store_bank_card", "store_flow", "store_profession", "store_role", "store_staff", "store_staff_flow", "store_staff_ref", "store_staff_wallet"});
//        config.setModuleName("retail");
//        config.setIncludeTables(new String[]{"retail_order"});
        config.setTablePrefix(new String[]{});
        config.setOutputDir(outputDir);
        GeneratorService.execute(config);
    }

}
